package com.xiaotao.test01.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.ToString;

import java.util.Map;

/**
 * @author xiaotao
 */
@Data
@ToString
@AllArgsConstructor
public class Result {
    // 201 心跳 200 连接   400 错误  300 消息
    private String code;
    private String message;
    private Map<String,String> data;

    public static Result success(Map<String,String> data){
        return new Result("200","success", data);
    }
    public static Result health(){
        return new Result("201","health OK", null);
    }
    public static Result error(String message){
        return new Result("400",message, null);
    }
}
